package org.example.model;

import lombok.Data;
import org.example.order.OrderDirection;

@Data
public class Order {
    private int mid;//会员ID
    private long uid;//TODO 用户ID，有了会员ID为什么还需要用户ID？
    private int code;
    private OrderDirection direction;
    private long price;
    private long volumn;
    private long completedVolumn;
    private long orderId;
    private long timestamp;

    public long getLeftVolumn() {
        return this.volumn - completedVolumn;
    }
    public void addCompletedVolumn(long volumn) {
        this.completedVolumn += volumn;
    }

    public boolean isFullMatch() {
        return this.volumn == this.completedVolumn;
    }
}
